/*******************************************************************************
 * Copyright (c) 2011 Olexandr V. Shaposhnikov.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Olexandr V. Shaposhnikov - initial API and implementation and/or initial documentation
 *******************************************************************************/
package com.funkyroach.use.ui.text;

import org.eclipse.dltk.ui.editor.highlighting.SemanticHighlighting;
import org.eclipse.dltk.ui.text.ScriptSourceViewerConfiguration;
import org.eclipse.dltk.ui.text.ScriptTextTools;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.rules.IPartitionTokenScanner;
import org.eclipse.ui.texteditor.ITextEditor;

public class USTextTools extends ScriptTextTools {

    private IPartitionTokenScanner fPartitionScanner;

    private final static String[] LEGAL_CONTENT_TYPES = new String[] { IUSPartitionTokens.US_STRING_TYPE,
            IUSPartitionTokens.US_COMMENT_TYPE };

    public USTextTools(boolean autoDisposeOnDisplayDispose) {
        super(IUSPartitionTokens.US_PARTITIONING, LEGAL_CONTENT_TYPES, autoDisposeOnDisplayDispose);
        fPartitionScanner = new USPartitionTokenScanner();
    }

    public ScriptSourceViewerConfiguration createSourceViewerConfiguraton(IPreferenceStore preferenceStore,
            ITextEditor editor, String partitioning) {
        return new USSourceViewerConfiguration(getColorManager(), preferenceStore, editor, partitioning);
    }

    public IPartitionTokenScanner getPartitionScanner() {
        return fPartitionScanner;
    }

    public SemanticHighlighting[] getSemanticHighlightings() {
        return new SemanticHighlighting[0];
    }

  

}
